package jp.lab1;
import java.util.Random;


public class TestMain {
	public static void main(String[] args) {
		//SecureControlPoint cp = new SecureControlPoint("1");
		//cp.start();
		//cp.search();
		//cp.secureRegister();
		Random r = new Random();
		
		SecureControlPoint [] cpList = new SecureControlPoint[101];
		Thread[] t = new Thread[101];
		
		
		
		for(int i=1; i<101; i++){
			
		
			cpList[i] = new SecureControlPoint(String.valueOf(i));
			cpList[i].setSSDPPort(8008+i);
			//cpList[i].start();
			//cpList[i].search();
			//cpList[i].secureRegister();
			//cpList[i].regist();
			
			// 100 nodes rand 600,000
			t[i] = new Thread(new Worker(cpList[i], r.nextInt(10000)));
			
			
			//System.out.println("REGISTERED ID="+i);
			
			//cpList[i].testSecureGroup();
			//cpList[i].stop();
		}
		
		for(int i=1; i<10; i++){
			t[i].start();
			
			
		}

		
		System.out.println("[MAIN]ALL NODE STARTED");
		
	}
	
	
}
